﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EmployeeApp.Web.Models.Employee;

namespace EmployeeApp.Web.Mapper.Employee
{
    public class EmployeeMapper
    {
        public EmployeeModel Mapping(EmployeeService.EmployeeDto inputDto)
        {
            EmployeeModel result = new EmployeeModel
            {
                Id = inputDto.Id,
                EmpId = inputDto.EmpId,
                Name = inputDto.Name,
                Surname = inputDto.Surname,
                Title = inputDto.Title,
                Address = inputDto.Address,
                JobTitle = inputDto.JobTitle,
                MarriedStatus = inputDto.MarriedStatus,
                BirthDate = inputDto.BirthDate,
                Status = inputDto.Status
            };

            return result;
        }

        public static List<EmployeeStatusModel> GetEmployeeStatusForDDL()
        {

            List<EmployeeStatusModel> result = GetEmployeeStatus();
            result.Add(new EmployeeStatusModel() { StatusId = 0, StatusName = "All" });

            return result.OrderBy(s => s.StatusId).ToList();
        }

        public static List<EmployeeStatusModel> GetEmployeeStatus()
        {
            //TODO get status list from BL
            List<EmployeeStatusModel> result = new List<EmployeeStatusModel>(){
                new EmployeeStatusModel(){ StatusId=1, StatusName="Active"},
                new EmployeeStatusModel(){ StatusId=2, StatusName="Inactive"}
            };
            return result;
        }
    }
}